home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / srplgrob.doc < prev    next >
Text File  |  1995-03-31  |  6KB  |  140 lines

  1. (Comp.sys.hp48) 
  2. Item: 2346 by stvlin04@uctvax.uct.ac.za [Richard Steventon] 
  3. Subj: Include a GROB in SYS-RPL & ML (DOC) 
  4. Date: 24 Oct 1993 
  5.  
  6. Well, since there have been several queries in this newsgroup about how to 
  7. include a grob in SYS-RPL source for RPLCOMP, I thought that I would post 
  8. the following doc that has resulted from help that I received. 
  9.  
  10. Thanks to Detlef and Fatri. 
  11.  
  12. There are two source files included below.  They APPEAR to work fine on 
  13. my (and have only been tested on) Revision E 48sx.  Use them however you 
  14. see fit. 
  15.  
  16. BEGIN SYS-RPL_EXAMPLE 
  17. ***************************************************************************** 
  18. * Modulname:     Include_Grob 
  19. * Modultype:     User level secondary 
  20. * Dest.Comp.:    HP48 
  21. * Language:      System RPL                         ____  
  22. * Author:        Richard Steventon, Cape Town  /\_/      \_/\ 
  23. * Interface:     (-->) 
  24. * Description:    
  25. * Edition History : First included with Lemming (by DM) and later both with 
  26. *                  : TETRIS (also by Detlef) 
  27. ***************************************************************************** 
  28.  
  29.          TITLE   Include Grob v 1.0 
  30.  
  31. ASSEMBLE 
  32.          NIBASC  /HPHP48-E/      Binary download header 
  33.  
  34. RPL 
  35. ASSEMBLE 
  36. ****************************************************** 
  37. ** Macro to show grob on screen ** 
  38. MKGROB   MACRO           * x,y 
  39.          CON(5)  =DOGROB                 * prolog 
  40.          CON(5)  15+(($1+7)/8)*$2*2      * compute size 
  41.          CON(5)  $2                      * height 
  42.          CON(5)  $1                      * length 
  43. MKGROB   ENDM 
  44. ****************************************************** 
  45.  
  46. RPL 
  47. :: 
  48. CK0NOLASTWD                      ( * Zero Arguments * ) 
  49. ClrDA1IsStat                     ( * Suspend clock  * ) 
  50. TURNMENUOFF 
  51. CLEARVDISP                       ( * Clear the display * ) 
  52. ASSEMBLE 
  53.          MKGROB  128,25          * grob 128 x 25  
  54.          NIBHEX  0CFFFDEFFFF10C06CF9168910EFEFDF30EFF7C0CFFF30C06EF9168910 
  55.          NIBHEX  FFEFDF30EFF1E00FFF30C0660816891030030600EFF0600EFF30C0660 
  56.          NIBHEX  83FC91030030600EF70600CFF30CF7EF03FC810F7030600EF307008FF 
  57.          NIBHEX  30CF7EF0FFF810F7030600EF303008FF30C06600E9781030030600EF1 
  58.          NIBHEX  03000FF30C06600E9781030030600EF18F3F3FF30C06EF1C038F3FF03 
  59.          NIBHEX  0600EF08F3F7EF30C06CF1C030F3EF030600EF081336EF30000000000 
  60.          NIBHEX  00000000000EF0C9B37EF3000000000000000000000EF0C8913EF3000 
  61.          NIBHEX  000000000000000000EF0C8913EF3000000000000000000000EF0ECD9 
  62.          NIBHEX  3EF3000000000000000000000EF16CC81FF30CF1810F3683818F3CF10 
  63.          NIBHEX  EF16CCF1FF30CF3818F76C1818F7CF30EF37EEF0FF30C03C38166E0C3 
  64.          NIBHEX  816C030EF300608FF30C03C3810670C3816C030EF700608FF30C03668 
  65.          NIBHEX  10E3066816C030EFF0070CFF30CF366810E30668F3C030EFF1030EFF3 
  66.          NIBHEX  0CF1FF810670FF8F3C030EFF3030FFF30C00FF8166E0FF816C030EFFF 
  67.          NIBHEX  81CFFF30C003C8F76C13C816CF30CFFFBDFFFF10C003C0F36833C816CF1 
  68. RPL 
  69. ABUFF ZERO TWENTY GROB!          ( * copy grob over screen at 0,20 * ) 
  70. SetDA123NoCh                     ( * Freeze display until keypress * ) 
  71. ***************************************************************************** 
  72. END SYS-RPL_EXAMPLE 
  73.  
  74.  
  75. BEGIN ML_EXAMPLE 
  76. ***************************************************************************** 
  77. * Modulname:     grob 
  78. * Modultype:     User level secondary 
  79. * Dest.Comp.:    HP48 
  80. * Language:      SASM                                  ____ 
  81. * Author:        Richard Steventon , Cape Town    /\_/      \_/\ 
  82. * Interface:     (-->) 
  83. * Description:   writes to the screen a grob object whose data is in the 
  84. code 
  85. *                body 
  86. * Edition History : 13-08-93 asked Fatri Mohammed how to do it 
  87. *                  : 17-08-93 wrote this file as an eg 
  88. ***************************************************************************** 
  89.  
  90.          TITLE   ML Display Grob v1.0 
  91.  
  92. ASSEMBLE 
  93.          NIBASC  /HPHP48-E/      Binary download header 
  94. RPL 
  95. CODE 
  96.          GOSBVL  =SAVPTR         * save registers 
  97.          D0=(5)  =VDISP          * pointer to address of stack grob 
  98.          C=DAT0  A               * get address 
  99.          LA(5)   20+34*21+11     * add prolog(20) + lines down(21) + offset(11) 
  100.          C=C+A   A               * add them 
  101.          CD0EX                   * put resulting address in D0 
  102.  
  103. * The next instruction is a GOSUB and the return address is stored  
  104. * in RSTK ie the adddress of the following instruction (in this case 
  105. * it is the grob data) 
  106.          GOSUB   next             
  107.          NIBHEX  EFFF6FFFFF00FFF360EFFF10FFF0708FFF10FF70300FFF10FF30300EFF10 
  108.          NIBHEX  FF18300CFF10FF18100CFF10FF081008FF10FF0CF9F9FF10F70CF9F3FF10 
  109.          NIBHEX  F70C8913FF10F70ECD93FF10F706CC81FF10F706CC81FF10F707EEC1FF10 
  110.          NIBHEX  FF0366C8FF10FF036EF8FF10FF937F78FF10FF10030CFF10FF30030CFF10 
  111.          NIBHEX  FF70830EFF10FFF0810FFF10FFF1818FFF10FFF7C0EFFF10EFFFDEFFFF00 
  112.  
  113. next     C=RSTK                  * get address of grob data from RSTK 
  114.          CD1EX                   * put address in D1 
  115. * D1 is address of grob data 
  116. * D0 is address of offset in screen       
  117.          LA(2)   25-1            * counter (grob has 25 rows to write in loop) 
  118. loop     C=DAT1  12              * grob is 12 nibs wide so get first row 
  119.          DAT0=C  12              * write first row 
  120.          D1=D1+  12              * point to next 12 nibs of data 
  121.          D0=D0+  16              * \  
  122.          D0=D0+  16              *  > point to next line on screen 
  123.          D0=D0+  2               * / 
  124.          A=A-1   B               * decrement loop counter 
  125.          GONC    loop            * do until carry, then continue (exit) 
  126.          GOVLNG  =GETPTRLOOP     * restore registers 
  127. ENDCODE 
  128. ****************************************************************************** 
  129. END ML_EXAMPLE 
  130.  
  131.  
  132. Hopefully there are no mistakes.  Please notice that the ML one is only a 
  133. single Code object with the grob data included in it. 
  134.  
  135. Any questions?  Feel free to Email me and I will help you as much as I can. 
  136.  
  137. -Bye 
  138. -Richard 
  139.